<?php
// -----------------------------------------------------------------------------
// include
// -----------------------------------------------------------------------------

include "../../config/config.php";
include "../../auth.php";
include "../../DBManager.php";

// -----------------------------------------------------------------------------
// 数据库相关设置
// -----------------------------------------------------------------------------

$dbPath = "../../" . $dbPath; // 不加这行语句的话会报错，提示找不到对应路径
$db = new DBManager("sqlite:" . $dbPath);

// -----------------------------------------------------------------------------
// 访问设置
// -----------------------------------------------------------------------------

if (!isset($_POST["dayOfMonth"]) || !isset($_POST["content"])) {
    exit("需要传入有效的参数！");
}

$dayOfMonth = $_POST["dayOfMonth"];
$content = $_POST["content"];

// -----------------------------------------------------------------------------

$db->writeToMonthlyLunar($content, $dayOfMonth);
echo "已保存！";
